package com.whfp.coky.ui.task.model

import android.os.Parcel
import android.os.Parcelable

/**
 *
 *
 * created by coky on 2022/3/30
 */
class AutoBqBean() :Parcelable{
    var startC: Int? = null
    var endC: Int? = null
    var nameC: String? = null
    var startT1: Int? = null
    var endT1: Int? = null
    var nameT1: String? = null
    var startT2: Int? = null
    var endT2: Int? = null
    var nameT2: String? = null
    var startT3: Int? = null
    var endT3: Int? = null
    var nameT3: String? = null
    var formulaMode: String? = null
    var lowConcentration: Double? = null
    var varueAllVO: List<ValueAllVOBean>? = null

    constructor(parcel: Parcel) : this() {
        startC = parcel.readValue(Int::class.java.classLoader) as? Int
        endC = parcel.readValue(Int::class.java.classLoader) as? Int
        nameC = parcel.readString()
        startT1 = parcel.readValue(Int::class.java.classLoader) as? Int
        endT1 = parcel.readValue(Int::class.java.classLoader) as? Int
        nameT1 = parcel.readString()
        startT2 = parcel.readValue(Int::class.java.classLoader) as? Int
        endT2 = parcel.readValue(Int::class.java.classLoader) as? Int
        nameT2 = parcel.readString()
        startT3 = parcel.readValue(Int::class.java.classLoader) as? Int
        endT3 = parcel.readValue(Int::class.java.classLoader) as? Int
        nameT3 = parcel.readString()
        formulaMode = parcel.readString()
        lowConcentration = parcel.readValue(Double::class.java.classLoader) as? Double
        varueAllVO = parcel.createTypedArrayList(ValueAllVOBean)
    }

    class ValueAllVOBean() : Parcelable {
        var concentration: Double? = null
        var t1CValue: Double? = null
        var t2CValue: Double? = null
        var t3CValue: Double? = null

        constructor(parcel: Parcel) : this() {
            concentration = parcel.readValue(Double::class.java.classLoader) as? Double
            t1CValue = parcel.readValue(Double::class.java.classLoader) as? Double
            t2CValue = parcel.readValue(Double::class.java.classLoader) as? Double
            t3CValue = parcel.readValue(Double::class.java.classLoader) as? Double
        }

        override fun writeToParcel(parcel: Parcel, flags: Int) {
            parcel.writeValue(concentration)
            parcel.writeValue(t1CValue)
            parcel.writeValue(t2CValue)
            parcel.writeValue(t3CValue)
        }

        override fun describeContents(): Int {
            return 0
        }

        companion object CREATOR : Parcelable.Creator<ValueAllVOBean> {
            override fun createFromParcel(parcel: Parcel): ValueAllVOBean {
                return ValueAllVOBean(parcel)
            }

            override fun newArray(size: Int): Array<ValueAllVOBean?> {
                return arrayOfNulls(size)
            }
        }
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeValue(startC)
        parcel.writeValue(endC)
        parcel.writeString(nameC)
        parcel.writeValue(startT1)
        parcel.writeValue(endT1)
        parcel.writeString(nameT1)
        parcel.writeValue(startT2)
        parcel.writeValue(endT2)
        parcel.writeString(nameT2)
        parcel.writeValue(startT3)
        parcel.writeValue(endT3)
        parcel.writeString(nameT3)
        parcel.writeString(formulaMode)
        parcel.writeValue(lowConcentration)
        parcel.writeTypedList(varueAllVO)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<AutoBqBean> {
        override fun createFromParcel(parcel: Parcel): AutoBqBean {
            return AutoBqBean(parcel)
        }

        override fun newArray(size: Int): Array<AutoBqBean?> {
            return arrayOfNulls(size)
        }
    }
}